package com.serviceImpl;

import java.util.List;
import java.util.Map;

import com.bean.Product;
import com.dao.ProductDao;

public class ProductServiceImpl {

	private ProductDao productDao;

	public ProductDao getProductDao() {
		return productDao;
	}

	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}

	public List<Product> findAllProducts(String sql){
		return productDao.findAll(sql);
	}
	
	public int getTotalCount(String sql) {
		return productDao.getTotalCount(sql);
	}
	
	/**
	 * ��ѯ��Ʒ
	 */
	public List<Product> findProducts(String table,String pk,String sort,int PageNumber,int PageSize ,Map<String, Object> options){
		
		return productDao.getFindProducts(table, pk, sort, PageNumber, PageSize, options);
		
	}
	
	/**
	 *通过产品编码查找sku 
	 */
	public List<Product> findProductSKU(String productCd){
		return productDao.findByProductCode(productCd);
	}
	
	/**
	 * 查找产品的颜色
	 */
	public List findProductColor(String productCd){
		return productDao.findColor(productCd);
	}
	
	
	/**
	 * 查找产品的尺寸
	 */
	public List findProductSzid(String productCd){
		return productDao.findSzid(productCd);
	}
}
